local hash_key_ht = KEYS[1];
local hash_key = KEYS[2];
local hash_value = ARGV[1];

local bucket_key_zset = KEYS[3];
local bucket_member = ARGV[2];
local bucket_score = tonumber(ARGV[3]);

-- save hash
local result_1 = redis.call('HSET', hash_key_ht, hash_key, hash_value);

-- save zset
local result_2 = redis.call('ZADD', bucket_key_zset, bucket_score, bucket_member);

return result_1 + result_2;